<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../css/total.css"/>
	    <script type="text/javascript" src="../js/jquery-2.0.3.js"></script>
	    <script type="text/javascript" src="../js/rem.js"></script>
		<script type="text/javascript">
			$(window).load(function() {
				$('#box').delay(200).show()
			})
		</script>
	</head>
	<body>
		<!--页面加载 开始-->
		 <!-- <div id="preloader">
		    <div id="status">
		      <p class="center-text"><span>拼命加载中···</span></p>
		    </div>
		  </div>-->
		  <!--页面加载 结束--> 
		<div id="box">
			<!--头部区-->
			<header class="total-head">
				<i onclick="goBack()" class="iconfont">&#xe621;</i>
				<img src="../img/images/title_03.png"/>
				<i class="iconfont total-more">&#xe60b;</i>
			</header>
			<!--内容区-->
			<section class="total-cont">
				<div class="total-cont-top">
					<div class="total-cont-left">
						<i class="iconfont">&#xe602;</i>
						<p>我的收藏</p>
					</div>
					<div class="total-cont-middle">
						<!--<img src="../img/head.png"/>
						<div class="total-cont-user">
							<span class="user-name">王大锤子</span>
						<i class="iconfont">&#xe631;</i>
					   </div>-->
						
					</div>
					<div class="total-cont-right">
						<i class="iconfont">&#xe62b;</i>
						<p>我的评论</p>
					</div>
				</div>
				<div class="total-cont-foot">
					<ul>
						<li class="total-cont-myfocus">我关注的</li>
						<li class="total-cont-mynews">消息通知</li>
						<li>我的缓存</li>
						<li class="total-cont-view">意见反馈</li>
						<li>退出登录</li>
					</ul>
				</div>
			</section>
			
			<!--意见反馈弹出层-->
			<div class="mask">
			</div>
			<div class="mask-top ">
				<textarea class="mask-textarea" name="" ></textarea>
				<div class="mask-button clear">
					<div class="mask-delect">取消</div>
				    <div class="mask-send">发送</div>
				</div>
			</div>
			<!--用户昵称修改弹出层-->
			<div class="user-mask">
			</div>
			<div class="user-mask-top ">
				<input type="text" class="user-input" name="" />
				<div class="user-mask-button clear">
					<div class="user-mask-delect">取消</div>
				    <div class="user-mask-send">发送</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/reset.js"></script>
	<script type="text/javascript" src="../js/jquery-2.0.3.js"></script>
	<script type="text/javascript" src="../js/iscroll.js"></script>
	<script type="text/javascript">
	function goBack(){ 
    window.history.back() 
    } 
    /*跳转到收藏*/
    $('.total-cont-left').on('click',function(){
    	window.location.href='collection.html'
    })
    /*跳转到评论*/
     $('.total-cont-right').on('click',function(){
    	window.location.href='mycomments.html'
    })
     /*跳转到关注*/
     $('.total-cont-myfocus').on('click',function(){
    	window.location.href='myfocus.html'
    })
     /*跳转到到消息通知*/
     $('.total-cont-mynews').on('click',function(){
    	window.location.href='mynews.html'
    })
     
     $('.total-more').on('click',function(){
     	window.location.href='more.html'
     })
     /*意见反馈*/
    $('.total-cont-view').on('click',function(){
    	$('.mask').show()
    	$('.mask-top').show()
    })
    $('.mask-delect').on('click',function(){
    	$('.mask').hide()
    	$('.mask-top').hide()
    })
    $('.mask-send').on('click',function(){
    	$('.mask').hide()
    	$('.mask-top').hide()
    })
    /*修改用户昵称*/
   var b=localStorage.getItem("user_id")
   
    /*头像加载*/
    var b=localStorage.getItem("user_id")
	   console.log(b)
		$.ajax({
            type: 'POST',
            url: 'http://192.168.199.114:8080/HJF/user/get_user_comment_list.do',
            dataType: 'JSON',
            data:{user_id:b},
            success: function(data){
            	console.log(data)
            	var oImg=$('<img src="'+data.data.comment_list[0].user_head_img_url+'"/>')
            	var oDiv=$('<div class="total-cont-user">'+
							'<span class="user-name">'+data.data.comment_list[0].user_name+'</span>'+
						'<i class="iconfont">&#xe631;</i>'+
					   '</div>')
            	$('.total-cont-middle').append(oImg)
            	$('.total-cont-middle').append(oDiv)
            	 $('.total-cont-user').on('click',function(){
			    	$('.user-mask').show()
			    	$('.user-mask-top').show()
			    })
			    $('.user-mask-delect').on('click',function(){
			    	$('.user-mask').hide()
			    	$('.user-mask-top').hide()
			    })
			     $('.user-mask-send').on('click',function(){
			     	var username=$('.user-input').val()
			     	if(username==''){
			     		alert('请输入内容')
			     	}else{
			           console.log(b)
			           $('.user-name').html(username)
					 $.ajax({
			            type: 'POST',
			            url: 'http://192.168.199.114:8080/HJF/user/edit_user_name.do',
			            dataType: 'JSON',
			            data:{user_id:b,user_name:username},
			            success: function(data){
			            	
			            	console.log(data)
			            },
			            error: function(xhr, type){
			            }
			         });
			     	  $('.user-mask').hide()
			    	$('.user-mask-top').hide()	
			     	}
			    	
			    })
            },
            error: function(xhr, type){
            }
       });
       
       $.ajax({
            type: 'POST',
            url: 'http://192.168.199.114:8080/HJF/user/edit_user_head_img.do',
            dataType: 'JSON',
            data:{user_id:b},
            success: function(data){
            	console.log(data)
            },
            error: function(xhr, type){
            }
         });
	</script>
</html>
